package com.qmds.userserver.user.controller;


import com.qmds.common.core.vo.R;
import com.qmds.userserver.user.service.UploadService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * --- 天道酬勤 ---
 *
 * @author zhanghanxuan
 * @date 2024/8/22
 * @desc
 */
@RestController
@RequestMapping("/app/user")
public class UploadController {
    @Resource
    private UploadService uploadService;

    @PostMapping("/upload/img")
    public R<String> upload(MultipartFile file) {
        String path = uploadService.upload(file);
        System.out.println(path);
        return R.ok(path);
    }
}
